{extend name="base" /} {block name="body"}
<div class="layui-body">
	<div class="navbar">
		<a><cite>广告页设置</cite></a>&nbsp;<span class="layui-box">&gt;</span>
		<a href=""><cite>广告页</cite></a>
	</div>
	<form id="my_form" class="layui-form form-container" action="{:url('duobao')}" method="post">
		<div class="layui-form-item" >
			<label class="layui-form-label">内容</label>
			<div class="layui-input-block">
				<script style="width:960px;height:600px" id="content" name="content" type="text/plain">
					{if isset($adver_config)}{$adver_config|html_entity_decode}{/if}
				</script>
			</div>
		</div>
		<div class="layui-form-item update_btnbox" style="text-align: center;margin-left:unset">
				<div class="layui-input-block" style="max-width: unset;float: unset;">
					<button  id='change_but' class="layui-btn" type="button" onclick="set_content()"  lay-filter="demo1">立即提交</button>
					<button type="reset" class="layui-btn layui-btn-primary">重置</button>
				</div>
			</div>
	</form>
</div>
{/block}
{block name="js"}
<script type="text/javascript" src="/public/static/js/image.zip.js"></script>
<script type="text/javascript" src="/public/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="/public/ueditor/ueditor.all.js"></script>

<script>
	var ue = UE.getEditor('content', {
        initialFrameHeight: 450,
		serverUrl: "{:url('admin/ueditor/index?cate=news')}"
	});
	    //提交表单
	function set_content(){
  		 $.ajax({
             	type:"post",
                url:"{:url('advertise/setadver')}",
                data: $('#my_form').serialize(),//表单数据
                success:function(data){
                	layer.msg(data.msg, {
					  icon: 1,
					  time: 1500 //2秒关闭（如果不配置，默认是3秒）
					}, function(){
						
					});
                },error:function(data){
                	var a = data;
                }
        });
  		
  	}
</script>
{/block}
